package com.icetech.eom.dao.tx;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.icetech.eom.domain.sys.User;
import com.icetech.eom.domain.tx.Device;
import com.icetech.eom.domain.tx.dto.DeviceDto;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author wangzw
 * @since 2018-11-12
 */
public interface DeviceDao extends BaseMapper<Device> {

    /**
     * 查询设备信息
     * @param searchKey
     * @return
     */
    List<DeviceDto> selectBySearchKey(@Param("searchKey") String searchKey,@Param("orgId") Long orgId);

    /**
     * 查询当前用户绑定的设备信息
     * @param searchKey
     * @param userId
     * @return
     */
    List<Device> selectByUserIdAndSearchKey(@Param("searchKey") String searchKey, @Param("userId") Long userId);

    /**
     * 根据uid 获取设备信息
     * @param guid
     * @return
     */
    Device selectByGuid(@Param("guid") String guid);

    List<DeviceDto> selectListUnBindDevice(@Param("userId") Long userId, @Param("uid") String uid, @Param("fromUid") String fromUid, @Param("toUid") String toUid,@Param("orgId")Long orgId);

    List<Device> selectByCustomId(@Param("customId") Long customId);
}
